<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>讯飞语音转写工具</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
</head>
<body class="bg-gray-100 min-h-screen">
    <div class="container mx-auto px-4 py-8 max-w-4xl">
        <div class="bg-white rounded-lg shadow-lg p-8">
            <h1 class="text-3xl font-bold text-center text-blue-600 mb-8">
                <i class="fas fa-microphone-alt mr-2"></i>讯飞语音转写工具
            </h1>
            
            <div class="space-y-6">
                <!-- 文件上传区域 -->
                <div class="border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-blue-400 transition-colors">
                    <input type="file" id="audioFile" accept=".wav,.mp3,.m4a,.flac" class="hidden">
                    <div id="uploadArea" class="cursor-pointer">
                        <i class="fas fa-cloud-upload-alt text-4xl text-gray-400 mb-4"></i>
                        <p class="text-gray-600 mb-2">点击选择音频文件或拖拽文件到此处</p>
                        <p class="text-sm text-gray-500">支持格式：WAV, MP3, M4A, FLAC</p>
                    </div>
                    <div id="fileInfo" class="hidden mt-4">
                        <p class="text-green-600 font-medium">
                            <i class="fas fa-check-circle mr-1"></i>
                            <span id="fileName"></span>
                        </p>
                        <p class="text-sm text-gray-500 mt-1">
                            文件大小：<span id="fileSize"></span>
                        </p>
                    </div>
                </div>

                <!-- 转写按钮 -->
                <button id="transcribeBtn" class="w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-medium hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed transition-colors" disabled>
                    <i class="fas fa-language mr-2"></i>开始转写
                </button>

                <!-- 进度条 -->
                <div id="progressContainer" class="hidden">
                    <div class="bg-gray-200 rounded-full h-2 overflow-hidden">
                        <div id="progressBar" class="bg-blue-600 h-full transition-all duration-300" style="width: 0%"></div>
                    </div>
                    <p id="progressText" class="text-sm text-gray-600 mt-2 text-center">正在上传音频文件...</p>
                </div>

                <!-- 结果显示区域 -->
                <div id="resultContainer" class="hidden">
                    <div class="bg-gray-50 rounded-lg p-6">
                        <h3 class="text-lg font-semibold text-gray-800 mb-4">
                            <i class="fas fa-file-alt mr-2"></i>转写结果
                        </h3>
                        <div id="transcriptionResult" class="bg-white border border-gray-200 rounded p-4 min-h-[100px] text-gray-700 leading-relaxed"></div>
                        <div class="mt-4 flex justify-end space-x-3">
                            <button id="copyBtn" class="bg-gray-600 text-white px-4 py-2 rounded hover:bg-gray-700 transition-colors">
                                <i class="fas fa-copy mr-1"></i>复制文本
                            </button>
                            <button id="clearBtn" class="bg-red-600 text-white px-4 py-2 rounded hover:bg-red-700 transition-colors">
                                <i class="fas fa-trash mr-1"></i>清除结果
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="app.js"></script>
</body>
</html>
